﻿using IOA.MES.Client.Models.Response;
using System.Windows;
using System.Windows.Forms;

namespace IOA.MES.Client.IV
{
    /// <summary>
    /// WinIVResult.xaml 的交互逻辑
    /// </summary>
    public partial class WinIVResult : Window
    {
        public WinIVResult()
        {
            InitializeComponent();
        }

        public void SetComponent(Component component)
        {
            if (component != null)
            {
                lbBarCode.Content = component.BarCode;
                lbEffecial.Content = component.CellEfficiency;
                lbTheoreticalPower.Content = component.TheoreticalPower;
            }
        }

        public void SetIVResult(IVData data)
        {
            if (data != null)
            {
                lbPowerLevel.Content = data.PowerLevel ?? 0;
                lbCurrentLevel.Content = data.CurrentLevel;
                lbPmax.Content = data.Pmax ?? 0;
            }
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            this.Topmost = true;
        }
    }
}
